<template>
  <div>
    <el-form label-position="right" label-width="150px" size="mini">
      <!-- <el-form-item label='微信商户名称'>
        <el-input v-model="wechatMerchant.wechatMerchantName"></el-input>
      </el-form-item> -->
      <el-form-item label='公众号APPID'>
        <el-input v-model="wechatMerchant.pubAppId" @change="pubAppIdChange"></el-input>
      </el-form-item>
      <el-form-item label='公众号APPsecret'>
        <el-input v-model="wechatMerchant.pubAppSecret"></el-input>
      </el-form-item>
      <!-- <el-form-item label='公众号地址'>
        <span v-if="urlShow">{{url}}</span>
      </el-form-item> -->
      <el-form-item label='小程序APPID'>
        <el-input v-model="wechatMerchant.appId"></el-input>
      </el-form-item>
      <el-form-item label='小程序APPsecret'>
        <el-input v-model="wechatMerchant.secret"></el-input>
      </el-form-item>
      <el-form-item label='微信商户平台号'>
        <el-input v-model="wechatMerchant.wechatMerchantCode"></el-input>
      </el-form-item>
      <el-form-item label='商户平台APIkey'>
        <el-input v-model="wechatMerchant.apiKey"></el-input>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: 'wechatMerchantEditer',
  data(){
    return {
      url:'',
      urlShow:false
    }
  },
  methods:{
    pubAppIdChange(val){
      let url='https://api-merchant.nanxinwang.com/custom/#/?validcode=';
      url+=val;
      this.url=url;
      if(val.length>0)this.urlShow=true;
      else this.urlShow=false;
    }
  },
  mounted(){
    if(this.wechatMerchant.pubAppId.length>0)this.urlShow=true;
    else this.urlShow=false;
  },
  props:['wechatMerchant']
}
</script>

<style scoped>
.el-input{
  width:70%
}
</style>
